from 查找没用的图片 import listDir
from cgitb import text

files = listDir('/Users/wangshuguan/Desktop/软赛富的软著申请材料/软著资料/HSCS4.6.3_CAS',extensions=["cs"],reuslts = [])
print(len(files))
for filepath in files[20:30]:
    try:
        with open(filepath) as f:
            text = f.read()
            print(text)
    except FileNotFoundError:
        print('无法打开指定的文件!')
    except LookupError:
        print('指定了未知的编码!')
    except UnicodeDecodeError:
        print(f'读取文件时解码错误!{filepath}')
